package com.richinfo.proxy.dynamic.cglib;

import com.richinfo.proxy.demo.Subject;
import com.richinfo.proxy.demo.impl.RealSubject;

import net.sf.cglib.proxy.Enhancer;

/**
 * Created by WangXJ
 * 2019-07-04 15:02
 */
public class CglibClient {

	public static void main(String[] args) {

		Enhancer enhancer = new Enhancer();
		enhancer.setSuperclass(RealSubject.class);
		enhancer.setCallback(new DemoMethodInterceptor());
		
		Subject subject = (Subject) enhancer.create();
		subject.hello();
	}

}
